package chapter05;

public class Test03_StringBuffer {
    public static void main(String[] args) {
        StringBuffer s1 = new StringBuffer();
        //增加字符
        s1.append("abcd");
        System.out.println(s1);
        //插入
        s1.insert(1,"ef");
        System.out.println(s1);
        //删除 指定位置删除
        s1.deleteCharAt(1);
        System.out.println(s1);
        //指定范围删除
        s1.delete(3, s1.length());
        System.out.println(s1);
        //指定位置改变
        s1.setCharAt(0,'h');
        System.out.println(s1);
    }
}
